﻿package game.objects.num
{
	import flash.display.Sprite;
	import game.value.GameValues;
	/**
	 * ...
	 * @author ytl
	 */
	public class Num extends Sprite
	{
		var game:main;
		public function Num(mygame:main, type:String, num:Number) {
			game = mygame;
			if (num == 1)
			{
				twoNum(type);
			}
			else if (num == 2)
			{
				oneNum(type);
			}
		}
		
		public function oneNum(type:String):void {
			var temp:FiveK;
			switch (type) 
			{
				case GameValues.Chicken:
					temp = new FiveK(160, 265);
				break;
				case GameValues.Drink:
					temp = new TenK(135, 50);
				break;
				case GameValues.Jelly:
					temp = new OneK(160, 475);
				break;
				default:
			}
			game.stage.addChild(temp);
		}
		
		public function twoNum(type:String):void {
			var temp:FiveK;
			var temp2:FiveK;
			switch (type) 
			{
				case GameValues.Chicken:
					temp = new FiveK(160, 265);
					temp2 = new FiveK(150, 265);
				break;
				case GameValues.Drink:
					temp= new TenK(135, 50);
					temp2 = new TenK(125, 50);
				break;
				case GameValues.Jelly:
					temp = new OneK(160, 475);
					temp2 = new OneK(150, 475);
				break;
				default:
			}
			game.stage.addChild(temp);
			game.stage.addChild(temp2);
		}
	}
	
}